home *** CD-ROM | disk | FTP | other *** search
- class Fps
- {
- var mcContainer;
- var tfDisplay;
- var f;
- var t;
- function Fps()
- {
- this.mcContainer = _root.createEmptyMovieClip("mcContainer",9999);
- this.tfDisplay = this.mcContainer.createTextField("tfDisplay",this.mcContainer.getNextHighestDepth(),0,0,22,22);
- this.tfDisplay._x = Stage.width - this.tfDisplay._width;
- this.tfDisplay.border = true;
- this.tfDisplay.background = true;
- this.tfDisplay.backgroundColor = 16777215;
- this.f = 0;
- this.t = getTimer();
- this.mcContainer.onEnterFrame = mx.utils.Delegate.create(this,this.count);
- }
- function count(Void)
- {
- if(getTimer() - this.t > 1000)
- {
- this.tfDisplay.text = String(this.f);
- this.t = getTimer();
- this.f = 0;
- }
- else
- {
- this.f = this.f + 1;
- }
- }
- }
-